home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 277_01.zip / TEK4.H < prev    next >
Text File  |  1993-04-01  |  2KB  |  71 lines

  1. /*
  2.  *    tek4.h - hp7470a version
  3.  *    copyright 1987 Ronald Florence
  4.  */
  5.  
  6. #define Maxpts        1000
  7.  
  8. #define Points        0
  9. #define Solid        1
  10. #define Longdash    2
  11. #define Dotted        3
  12. #define Dotdash        4
  13. #define Shortdash    5
  14. #define Altcolor    2
  15.  
  16. extern    FILE    *plw;        /* plotter write file */
  17. extern    int    quit();        /* baleout function */
  18. extern    double    xm,        /* scalars */
  19.         ym,
  20.         xscale,
  21.         yscale;
  22.  
  23.  
  24. char    *linetype[] = {
  25.         "LT0",        /* Points */
  26.         "LT",        /* Solid */
  27.         "LT3",        /* Longdash */
  28.         "LT1,1",    /* Dotted */
  29.         "LT4",        /* Dotdash */
  30.         "LT2"        /* Shortdash */
  31.     };
  32.  
  33.  
  34. #define Clear_scr()
  35. #define Align(H, V)
  36. #define Set_line(L)    fprintf(plw, "%s", linetype[L])
  37. #define Increment(X,Y)    fprintf(plw, "PU%d,%d", X, Y)
  38. #define Wr_str(X, Y, p)    fprintf(plw, "LB%s\03", p)
  39. #define Switch_pen()    fprintf(plw, "SP%d", Altcolor)
  40.  
  41. #define Set_charsize(s)    cellw = charwd[s] * xm * (3 / 2);        \
  42.             fprintf(plw, "SI%.3f,%.3f",             \
  43.                 charwd[s] * xm /400, charht[s] * ym /400)
  44.  
  45. #define    Vector(N, PTS)    plot(N, PTS)
  46.  
  47. #define Marker(N, PTS)    {            \
  48.             Set_line (Points);    \
  49.             plot (N, PTS);        \
  50.             Set_line (Solid);    \
  51.             }
  52.  
  53. #define err(a)        if (!strcmp(a, "data"))                      \
  54.             fprintf(stderr, "hp: too many data points\n"), quit()
  55.         
  56.  
  57. plot (num, points)
  58.      int  num, points[];
  59. {
  60.   register    i;
  61.     
  62.   fprintf(plw, "PU%d,%d", points[0], points[1]);
  63.   if (num > 2) 
  64.     {    
  65.       fprintf(plw, "PD");
  66.       for (i = 2; i < num - 1; i++) 
  67.     fprintf(plw, "%d,", points[i]);
  68.       fprintf(plw, "%d", points[i]);
  69.     }
  70. }
  71.